package com.marry.contract.provider;

import com.marry.core.result.Wrapper;
import com.marry.contract.vo.MenuVo;
import com.marry.contract.vo.RoleVo;
import com.marry.contract.vo.SysUser;
import org.springframework.web.bind.annotation.PathVariable;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

/**
 * @path：com.marry.provider.UserProvider.java
 * @className：UserProvider.java
 * @description：用户接口
 * @author：杨超
 * @dateTime：2020/11/9 16:48
 * @editNote：
 */
public interface UserProvider {

    /**
     * 通过用户名查找user
     * @param username
     * @return
     */
    Wrapper<Mono<SysUser>> findByUsername(@PathVariable("username") String username);

    /**
     * 通过用户ID查找角色
     * @param userId
     * @return
     */
    Wrapper<Flux<RoleVo>> getRoleByUserId(@PathVariable("userId") String userId);

    /**
     * 获取角色权限
     * @param roleId
     * @return
     */
    Wrapper<Flux<MenuVo>> getRolePermission(@PathVariable("roleId") String roleId);
}
